//
//  VC2ForSearch.m
//  PCAForWar
//
//  Created by dllo on 16/2/29.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "VC2ForSearch.h"
#import "ModelForSearch.h"
#import "NetWorkHandler.h"

@interface VC2ForSearch () <NetWorkHandlerDelegate>

@property (nonatomic, retain) NSMutableArray *arrNews;
@property (nonatomic, retain) NSString *str;
@property (nonatomic, retain) UIWebView *web;
@property (nonatomic, retain) NSString *detailId;

@end

@implementation VC2ForSearch

- (void)dealloc{
    
    [_arrNews release];
    [_str release];
    [_detailId release];
    [super dealloc];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    
    [self handleData];
    
    self.web = [[UIWebView alloc] initWithFrame:self.view.bounds];
    
    [self.view addSubview:self.web];
    
}

#pragma mark 处理数据
- (void)handleData {
    
    self.arrNews = [NSMutableArray array];
    
    self.str = [NSString stringWithFormat:@"http://a3.pstatp.com/2/article/content/6/1/%@/?iid=3754115287&device_id=11707828487&ac=wifi&channel=wandoujia&aid=1097&app_name=news_article&version_code=364&device_platform=android&device_type=Letv X500&os_api=21&os_version=5.0.2&uuid=868256022093115&openudid=bbfc8503d59f7c2e&aid=1097", self.groupId];
    
    [NetWorkHandler handlerJSONWithURL:self.str delegate:self];
    
    
}

- (void)handlerDidComplete:(id)result {
    
    NSDictionary *dic1 = [result objectForKey:@"data"];
    
    ModelForSearch *model = [[ModelForSearch alloc] init];
    
    model.content = [dic1 objectForKey:@"content"];
    
    [self.web loadHTMLString:model.content baseURL:nil];
    
    [model release];
}






//- (void)didReceiveMemoryWarning {
//    [super didReceiveMemoryWarning];
//    // Dispose of any resources that can be recreated.
//}
//
//



/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
